<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>线程池: inc/threads_pool.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">线程池<span id="projectnumber">&#160;1.0.0</span>
   </div>
   <div id="projectbrief">多线程并发工具</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#typedef-members">类型定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">threads_pool.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>线程池模块头文件  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;pthread.h&gt;</code><br />
<code>#include &lt;stdbool.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
threads_pool.h 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h__incl.png" border="0" usemap="#ainc_2threads__pool_8h" alt=""/></div>
</div>
</div><div class="textblock"><div class="dynheader">
此图展示该文件直接或间接的被哪些文件引用了:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h__dep__incl.png" border="0" usemap="#ainc_2threads__pool_8hdep" alt=""/></div>
</div>
</div>
<p><a href="threads__pool_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtask_msg.html">taskMsg</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">任务信息结构体  <a href="structtask_msg.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structthread_msg.html">threadMsg</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程信息结构体  <a href="structthread_msg.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structthreads_pool_msg.html">threadsPoolMsg</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程池信息结构体  <a href="structthreads_pool_msg.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:ade228054bfa068c8720ccbdd9bd60f1f" id="r_ade228054bfa068c8720ccbdd9bd60f1f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#ade228054bfa068c8720ccbdd9bd60f1f">READY_CLEAN_UP_AND_LOCK</a>(cleanUpHandleFuncPt,  mtxUnPt)</td></tr>
<tr class="memdesc:ade228054bfa068c8720ccbdd9bd60f1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">准备清理并加锁的宏  <br /></td></tr>
<tr class="separator:ade228054bfa068c8720ccbdd9bd60f1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad77b3322f3824da508dfbd0d04aa1a3" id="r_aad77b3322f3824da508dfbd0d04aa1a3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#aad77b3322f3824da508dfbd0d04aa1a3">UNLOCK_AND_CANCEL_CLEAN_UP</a>(mtxUnPt)</td></tr>
<tr class="memdesc:aad77b3322f3824da508dfbd0d04aa1a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">解锁并取消清理的宏  <br /></td></tr>
<tr class="separator:aad77b3322f3824da508dfbd0d04aa1a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab550e9b3cc1d47242c9baf6ad76334a" id="r_aab550e9b3cc1d47242c9baf6ad76334a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#aab550e9b3cc1d47242c9baf6ad76334a">SHOW_DEBUG</a>&#160;&#160;&#160;    fprintf(stderr, &quot;| FILE: %s | FUNC: %s  | LINE: %d  |\n&quot;, __FILE__, __FUNCTION__, __LINE__);</td></tr>
<tr class="memdesc:aab550e9b3cc1d47242c9baf6ad76334a"><td class="mdescLeft">&#160;</td><td class="mdescRight">调试信息显示宏  <br /></td></tr>
<tr class="separator:aab550e9b3cc1d47242c9baf6ad76334a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
类型定义</h2></td></tr>
<tr class="memitem:a7caec486a7d72810bcf5d474a87cdf0e" id="r_a7caec486a7d72810bcf5d474a87cdf0e"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structtask_msg.html">taskMsg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a7caec486a7d72810bcf5d474a87cdf0e">TaskMsg_st</a></td></tr>
<tr class="memdesc:a7caec486a7d72810bcf5d474a87cdf0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">任务信息结构体  <br /></td></tr>
<tr class="separator:a7caec486a7d72810bcf5d474a87cdf0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf857be8d505f4cc5457764683476a96" id="r_abf857be8d505f4cc5457764683476a96"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structtask_msg.html">taskMsg</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a></td></tr>
<tr class="separator:abf857be8d505f4cc5457764683476a96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa588c06cf4a4c4a03c25a9e11086b492" id="r_aa588c06cf4a4c4a03c25a9e11086b492"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structthread_msg.html">threadMsg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#aa588c06cf4a4c4a03c25a9e11086b492">ThreadMsg_st</a></td></tr>
<tr class="memdesc:aa588c06cf4a4c4a03c25a9e11086b492"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程信息结构体  <br /></td></tr>
<tr class="separator:aa588c06cf4a4c4a03c25a9e11086b492"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4d780691b4e7bc3472f4612e32a9c58" id="r_ae4d780691b4e7bc3472f4612e32a9c58"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structthread_msg.html">threadMsg</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a></td></tr>
<tr class="separator:ae4d780691b4e7bc3472f4612e32a9c58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f01da986f606db591863f482cf7c21a" id="r_a6f01da986f606db591863f482cf7c21a"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structthreads_pool_msg.html">threadsPoolMsg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a6f01da986f606db591863f482cf7c21a">ThreadsPoolMsg_st</a></td></tr>
<tr class="memdesc:a6f01da986f606db591863f482cf7c21a"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程池信息结构体  <br /></td></tr>
<tr class="separator:a6f01da986f606db591863f482cf7c21a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a467b16d23990346745beeffa68a36f" id="r_a5a467b16d23990346745beeffa68a36f"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structthreads_pool_msg.html">threadsPoolMsg</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a></td></tr>
<tr class="separator:a5a467b16d23990346745beeffa68a36f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a871605529dee3dac1537de63589ab108" id="r_a871605529dee3dac1537de63589ab108"><td class="memItemLeft" align="right" valign="top"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a871605529dee3dac1537de63589ab108">getNewThreadsPoolMsg</a> (int orgActiveThreadsCot, int maxWaitingTasksCot, int maxActiveThreadsCot)</td></tr>
<tr class="memdesc:a871605529dee3dac1537de63589ab108"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建新的线程池  <br /></td></tr>
<tr class="separator:a871605529dee3dac1537de63589ab108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ceec63a2e1c63606f561486b0b24e72" id="r_a3ceec63a2e1c63606f561486b0b24e72"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a3ceec63a2e1c63606f561486b0b24e72">addNewTask</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, void *(*handleFuncPt)(void *arg), void *handleFuncArg)</td></tr>
<tr class="memdesc:a3ceec63a2e1c63606f561486b0b24e72"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加新任务到线程池  <br /></td></tr>
<tr class="separator:a3ceec63a2e1c63606f561486b0b24e72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ebefc9eea4454da73914b2e62c3ef54" id="r_a7ebefc9eea4454da73914b2e62c3ef54"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a7ebefc9eea4454da73914b2e62c3ef54">reduceTask</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, void *(*destHandleFuncPt)(void *arg))</td></tr>
<tr class="memdesc:a7ebefc9eea4454da73914b2e62c3ef54"><td class="mdescLeft">&#160;</td><td class="mdescRight">从线程池中移除指定任务  <br /></td></tr>
<tr class="separator:a7ebefc9eea4454da73914b2e62c3ef54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c97656e7bb9d4709eca4ed29abf9d9c" id="r_a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a3c97656e7bb9d4709eca4ed29abf9d9c">addThread</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">向线程池中添加新线程  <br /></td></tr>
<tr class="separator:a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbfdf354a44f65186b3dfdd80e566b59" id="r_afbfdf354a44f65186b3dfdd80e566b59"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#afbfdf354a44f65186b3dfdd80e566b59">reduceThread</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:afbfdf354a44f65186b3dfdd80e566b59"><td class="mdescLeft">&#160;</td><td class="mdescRight">从线程池中移除线程  <br /></td></tr>
<tr class="separator:afbfdf354a44f65186b3dfdd80e566b59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ebf8832444bfb71e5cc1549ec38e354" id="r_a9ebf8832444bfb71e5cc1549ec38e354"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8h.html#a9ebf8832444bfb71e5cc1549ec38e354">destroyThreadsPoolMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a9ebf8832444bfb71e5cc1549ec38e354"><td class="mdescLeft">&#160;</td><td class="mdescRight">销毁线程池  <br /></td></tr>
<tr class="separator:a9ebf8832444bfb71e5cc1549ec38e354"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>线程池模块头文件 </p>
<p>该模块定义了一个线程池的实现，用于管理多个工作线程和处理任务队列。 线程池可以动态添加/删除线程和任务，支持任务取消和线程池安全销毁。</p>
<dl class="section author"><dt>作者</dt><dd>连佳炜 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2025-09-12 </dd></dl>
<dl class="section version"><dt>版本</dt><dd>1.0.0</dd></dl>
<dl class="section note"><dt>注解</dt><dd>使用前需确保系统支持pthread线程库 </dd></dl>
<dl class="section warning"><dt>警告</dt><dd>线程池销毁时会等待所有任务完成，请确保任务函数能够正常退出 </dd></dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8h_source.html">threads_pool.h</a> 中定义.</p>
</div><h2 class="groupheader">宏定义说明</h2>
<a id="ade228054bfa068c8720ccbdd9bd60f1f" name="ade228054bfa068c8720ccbdd9bd60f1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade228054bfa068c8720ccbdd9bd60f1f">&#9670;&#160;</a></span>READY_CLEAN_UP_AND_LOCK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define READY_CLEAN_UP_AND_LOCK</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">cleanUpHandleFuncPt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mtxUnPt&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line">    pthread_cleanup_push((cleanUpHandleFuncPt), (mtxUnPt)); \</div>
<div class="line">    pthread_mutex_lock((mtxUnPt));</div>
</div><!-- fragment -->
<p>准备清理并加锁的宏 </p>
<p>压入清理处理函数并对互斥锁加锁，用于实现线程安全</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">cleanUpHandleFuncPt</td><td>清理处理函数指针 </td></tr>
    <tr><td class="paramname">mtxUnPt</td><td>互斥锁指针 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8h_source.html">threads_pool.h</a> 第 <a class="el" href="threads__pool_8h_source.html#l00080">80</a> 行定义.</p>

</div>
</div>
<a id="aab550e9b3cc1d47242c9baf6ad76334a" name="aab550e9b3cc1d47242c9baf6ad76334a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab550e9b3cc1d47242c9baf6ad76334a">&#9670;&#160;</a></span>SHOW_DEBUG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SHOW_DEBUG&#160;&#160;&#160;    fprintf(stderr, &quot;| FILE: %s | FUNC: %s  | LINE: %d  |\n&quot;, __FILE__, __FUNCTION__, __LINE__);</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>调试信息显示宏 </p>
<p>显示当前文件名、函数名和行号信息 </p>

<p class="definition">在文件 <a class="el" href="threads__pool_8h_source.html">threads_pool.h</a> 第 <a class="el" href="threads__pool_8h_source.html#l00100">100</a> 行定义.</p>

</div>
</div>
<a id="aad77b3322f3824da508dfbd0d04aa1a3" name="aad77b3322f3824da508dfbd0d04aa1a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad77b3322f3824da508dfbd0d04aa1a3">&#9670;&#160;</a></span>UNLOCK_AND_CANCEL_CLEAN_UP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UNLOCK_AND_CANCEL_CLEAN_UP</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mtxUnPt</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line">    pthread_mutex_unlock((mtxUnPt)); \</div>
<div class="line">    pthread_cleanup_pop(0);</div>
</div><!-- fragment -->
<p>解锁并取消清理的宏 </p>
<p>对互斥锁解锁并弹出清理处理函数（不执行）</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">mtxUnPt</td><td>互斥锁指针 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8h_source.html">threads_pool.h</a> 第 <a class="el" href="threads__pool_8h_source.html#l00091">91</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">类型定义说明</h2>
<a id="a7caec486a7d72810bcf5d474a87cdf0e" name="a7caec486a7d72810bcf5d474a87cdf0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7caec486a7d72810bcf5d474a87cdf0e">&#9670;&#160;</a></span>TaskMsg_st</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structtask_msg.html">taskMsg</a> <a class="el" href="threads__pool_8h.html#a7caec486a7d72810bcf5d474a87cdf0e">TaskMsg_st</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>任务信息结构体 </p>
<p>用于存储任务的相关信息，包括处理函数和参数，构成双向链表 </p>

</div>
</div>
<a id="abf857be8d505f4cc5457764683476a96" name="abf857be8d505f4cc5457764683476a96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf857be8d505f4cc5457764683476a96">&#9670;&#160;</a></span>TaskMsg_st_pt</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structtask_msg.html">taskMsg</a> * <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa588c06cf4a4c4a03c25a9e11086b492" name="aa588c06cf4a4c4a03c25a9e11086b492"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa588c06cf4a4c4a03c25a9e11086b492">&#9670;&#160;</a></span>ThreadMsg_st</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structthread_msg.html">threadMsg</a> <a class="el" href="threads__pool_8h.html#aa588c06cf4a4c4a03c25a9e11086b492">ThreadMsg_st</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>线程信息结构体 </p>
<p>用于存储线程的相关信息，构成双向链表 </p>

</div>
</div>
<a id="ae4d780691b4e7bc3472f4612e32a9c58" name="ae4d780691b4e7bc3472f4612e32a9c58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4d780691b4e7bc3472f4612e32a9c58">&#9670;&#160;</a></span>ThreadMsg_st_pt</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structthread_msg.html">threadMsg</a> * <a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6f01da986f606db591863f482cf7c21a" name="a6f01da986f606db591863f482cf7c21a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f01da986f606db591863f482cf7c21a">&#9670;&#160;</a></span>ThreadsPoolMsg_st</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structthreads_pool_msg.html">threadsPoolMsg</a> <a class="el" href="threads__pool_8h.html#a6f01da986f606db591863f482cf7c21a">ThreadsPoolMsg_st</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>线程池信息结构体 </p>
<p>包含线程池的所有状态信息和管理结构 </p>

</div>
</div>
<a id="a5a467b16d23990346745beeffa68a36f" name="a5a467b16d23990346745beeffa68a36f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a467b16d23990346745beeffa68a36f">&#9670;&#160;</a></span>ThreadsPoolMsg_st_pt</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structthreads_pool_msg.html">threadsPoolMsg</a> * <a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a3ceec63a2e1c63606f561486b0b24e72" name="a3ceec63a2e1c63606f561486b0b24e72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ceec63a2e1c63606f561486b0b24e72">&#9670;&#160;</a></span>addNewTask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int addNewTask </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>handleFuncPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>handleFuncArg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>添加新任务到线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramname">handleFuncPt</td><td>任务处理函数指针 </td></tr>
    <tr><td class="paramname">handleFuncArg</td><td>任务处理函数参数</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>如果任务队列已满，添加会失败 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址  </td></tr>
    <tr><td class="paramname">handleFuncPt</td><td>处理函数地址  </td></tr>
    <tr><td class="paramname">handleFuncArg</td><td>处理函数参数 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00396">396</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00050">getNewTaskMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00079">inqueueNewTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00065">threadsPoolMsg::maxWaitingTasksCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a3ceec63a2e1c63606f561486b0b24e72_cgraph.png" border="0" usemap="#athreads__pool_8h_a3ceec63a2e1c63606f561486b0b24e72_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a3ceec63a2e1c63606f561486b0b24e72_icgraph.png" border="0" usemap="#athreads__pool_8h_a3ceec63a2e1c63606f561486b0b24e72_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a3c97656e7bb9d4709eca4ed29abf9d9c" name="a3c97656e7bb9d4709eca4ed29abf9d9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c97656e7bb9d4709eca4ed29abf9d9c">&#9670;&#160;</a></span>addThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int addThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>向线程池中添加新线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>线程数量不能超过最大限制 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00456">456</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00276">insertNewThreadMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00066">threadsPoolMsg::maxActiveThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a3c97656e7bb9d4709eca4ed29abf9d9c_cgraph.png" border="0" usemap="#athreads__pool_8h_a3c97656e7bb9d4709eca4ed29abf9d9c_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a3c97656e7bb9d4709eca4ed29abf9d9c_icgraph.png" border="0" usemap="#athreads__pool_8h_a3c97656e7bb9d4709eca4ed29abf9d9c_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a9ebf8832444bfb71e5cc1549ec38e354" name="a9ebf8832444bfb71e5cc1549ec38e354"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ebf8832444bfb71e5cc1549ec38e354">&#9670;&#160;</a></span>destroyThreadsPoolMsg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void destroyThreadsPoolMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>销毁线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>会等待所有任务完成后再销毁资源 </dd></dl>
<dl class="section warning"><dt>警告</dt><dd>线程池销毁后不能再使用 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00556">556</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00535">destroyTaskMsgsLinkedQueue()</a>, <a class="el" href="threads__pool_8c_source.html#l00513">destroyThreadMsgsLinkedList()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a9ebf8832444bfb71e5cc1549ec38e354_cgraph.png" border="0" usemap="#athreads__pool_8h_a9ebf8832444bfb71e5cc1549ec38e354_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a9ebf8832444bfb71e5cc1549ec38e354_icgraph.png" border="0" usemap="#athreads__pool_8h_a9ebf8832444bfb71e5cc1549ec38e354_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a871605529dee3dac1537de63589ab108" name="a871605529dee3dac1537de63589ab108"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a871605529dee3dac1537de63589ab108">&#9670;&#160;</a></span>getNewThreadsPoolMsg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> getNewThreadsPoolMsg </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>orgActiveThreadsCot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxWaitingTasksCot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxActiveThreadsCot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建新的线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orgActiveThreadsCot</td><td>初始活跃线程数量 </td></tr>
    <tr><td class="paramname">maxWaitingTasksCot</td><td>最大等待任务数量 </td></tr>
    <tr><td class="paramname">maxActiveThreadsCot</td><td>最大活跃线程数量</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回线程池指针，失败返回NULL</dd></dl>
<dl class="section note"><dt>注解</dt><dd>初始线程数量不能为0，最大数量限制必须合理</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">orgActiveThreadsCot</td><td>初始活跃线程数量 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxWaitingTasksCot</td><td>最大等待任务数量 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxActiveThreadsCot</td><td>最大活跃线程数量</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回线程池指针，失败返回NULL </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orgActiveThreadsCot</td><td>初始活跃线程量  </td></tr>
    <tr><td class="paramname">maxWaitingTasksCot</td><td>最大等待任务量  </td></tr>
    <tr><td class="paramname">maxActiveThreadsCot</td><td>最大活跃线程量 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00366">366</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00050">getNewTaskMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00341">insertSomeNewThreadMsgs()</a>, <a class="el" href="threads__pool_8h_source.html#l00066">threadsPoolMsg::maxActiveThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00065">threadsPoolMsg::maxWaitingTasksCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a>, <a class="el" href="threads__pool_8h_source.html#l00068">threadsPoolMsg::threadsLinkedListEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a871605529dee3dac1537de63589ab108_cgraph.png" border="0" usemap="#athreads__pool_8h_a871605529dee3dac1537de63589ab108_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a871605529dee3dac1537de63589ab108_icgraph.png" border="0" usemap="#athreads__pool_8h_a871605529dee3dac1537de63589ab108_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a7ebefc9eea4454da73914b2e62c3ef54" name="a7ebefc9eea4454da73914b2e62c3ef54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ebefc9eea4454da73914b2e62c3ef54">&#9670;&#160;</a></span>reduceTask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int reduceTask </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>destHandleFuncPt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>从线程池中移除指定任务 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramname">destHandleFuncPt</td><td>要移除的任务处理函数指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>只能移除尚未开始执行的任务 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池地址  </td></tr>
    <tr><td class="paramname">destHandleFuncPt</td><td>目标处理函数地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00431">431</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8c_source.html#l00134">removeDestTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_a7ebefc9eea4454da73914b2e62c3ef54_cgraph.png" border="0" usemap="#athreads__pool_8h_a7ebefc9eea4454da73914b2e62c3ef54_cgraph" alt=""/></div>
</div>

</div>
</div>
<a id="afbfdf354a44f65186b3dfdd80e566b59" name="afbfdf354a44f65186b3dfdd80e566b59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afbfdf354a44f65186b3dfdd80e566b59">&#9670;&#160;</a></span>reduceThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int reduceThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>从线程池中移除线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>至少保留一个活跃线程 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00486">486</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8c_source.html#l00298">removeThreadMsg()</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_afbfdf354a44f65186b3dfdd80e566b59_cgraph.png" border="0" usemap="#athreads__pool_8h_afbfdf354a44f65186b3dfdd80e566b59_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8h_afbfdf354a44f65186b3dfdd80e566b59_icgraph.png" border="0" usemap="#athreads__pool_8h_afbfdf354a44f65186b3dfdd80e566b59_icgraph" alt=""/></div>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2025年 九月 13日 星期六 03:23:00 , 为 线程池使用 &#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
